import 'package:flutter/material.dart';
import 'package:test_flutter/utils/factory/Fit.dart';

class Button extends StatefulWidget {

  final VoidCallback onPressed;
  final String title;
  Button(this.title, {this.onPressed});

  @override
  _ButtonState createState() => _ButtonState();
}

class _ButtonState extends State<Button> {


  @override
  Widget build(BuildContext context) {
    return new SizedBox(
      width: Fit.scaleX(880),
      height: Fit.scaleY(180),
      child: new FlatButton(
        color: Color(0xFF00E8A4),
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.only(
            topRight: Radius.circular(Fit.scaleX(90)),
            topLeft: Radius.circular(Fit.scaleX(90)),
            bottomRight: Radius.circular(Fit.scaleX(90)),
            bottomLeft: Radius.circular(Fit.scaleX(90)),
          ),
        ),
        child: new Padding(
          padding: new EdgeInsets.only(
            left: Fit.scaleX(20),
            right: Fit.scaleX(20),
            top: Fit.scaleX(20),
            bottom: Fit.scaleX(20),
          ),
          child: new Text(
            widget.title,
            style: new TextStyle(
                color: Colors.white, fontSize: Fit.scaleTextSize(48)),
          ),
        ),
        onPressed: widget.onPressed,
      ),
    );
  }
}




